package o;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.ViewDataBinding;

public class jm {
    private static jk ˊ = null;
    private static jj ˎ = new jo();

    public static <T extends ViewDataBinding> T ˎ(@NonNull LayoutInflater layoutInflater, int i, @Nullable ViewGroup viewGroup, boolean z) {
        return ˏ(layoutInflater, i, viewGroup, z, ˊ);
    }

    public static <T extends ViewDataBinding> T ˏ(@NonNull LayoutInflater layoutInflater, int i, @Nullable ViewGroup viewGroup, boolean z, @Nullable jk jkVar) {
        int i2 = 0;
        int i3 = (viewGroup == null || !z) ? 0 : 1;
        if (i3 != 0) {
            i2 = viewGroup.getChildCount();
        }
        View inflate = layoutInflater.inflate(i, viewGroup, z);
        if (i3 != 0) {
            return ˎ(jkVar, viewGroup, i2, i);
        }
        return ˊ(jkVar, inflate, i);
    }

    public static <T extends ViewDataBinding> T ˎ(jk jkVar, View[] viewArr, int i) {
        return ˎ.ˊ(jkVar, viewArr, i);
    }

    public static <T extends ViewDataBinding> T ˊ(jk jkVar, View view, int i) {
        return ˎ.ॱ(jkVar, view, i);
    }

    private static <T extends ViewDataBinding> T ˎ(jk jkVar, ViewGroup viewGroup, int i, int i2) {
        int childCount = viewGroup.getChildCount();
        int i3 = childCount - i;
        if (i3 == 1) {
            return ˊ(jkVar, viewGroup.getChildAt(childCount - 1), i2);
        }
        View[] viewArr = new View[i3];
        for (childCount = 0; childCount < i3; childCount++) {
            viewArr[childCount] = viewGroup.getChildAt(childCount + i);
        }
        return ˎ(jkVar, viewArr, i2);
    }
}
